package me.heshang.rednamedrop;

import me.heshang.rednamedrop.Connection.MySql;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

import java.sql.SQLException;

/**
 * 玩家进入服务器事件
 */
public class PlayerJoin implements Listener {

    @EventHandler
    public void PlayerJoin(PlayerJoinEvent e) throws SQLException, ClassNotFoundException {
        Player player = e.getPlayer();
        new MySql().join(player.getName());
        if (player.isOp() == true){
            player.sendMessage("§b|> §e感谢您使用红名惩罚插件");
            player.sendMessage("§b|> §e如您更换使用插件的机器需在群内授权解绑");
            player.sendMessage("§b|> §e插件交流群:§c783265251");
            player.sendMessage("§b|> §c付费版功能查看:§f https://docs.qq.com/doc/DYWFRZGdPb1JtaGR2");
            player.sendMessage("§b|> §e此消息仅op可见");
        }

    }

}
